package com.wangcang.widgetlibrary.tools;

import android.view.Gravity;
import android.widget.Toast;

import com.wangcang.widgetlibrary.activity.base.MobileApplication;
import com.wangcang.widgetlibrary.bubble.CustomToast;

/**
 * Created by Administrator on 2016/10/18.
 */

public class ToastUtils {

	public static void showToastAtTop(String text) {
		if (text != null) {
			CustomToast.makeText(MobileApplication.getApplicationInstance(), text, Toast.LENGTH_SHORT).setGravity(Gravity.TOP, 0, ConvertUtils.dip2px(MobileApplication.getApplicationInstance(), 90)).show();
		}
	}

	public static void showToastAtTop(int resource) {
		CustomToast.makeText(MobileApplication.getApplicationInstance(), resource, Toast.LENGTH_SHORT).setGravity(Gravity.TOP, 0, ConvertUtils.dip2px(MobileApplication.getApplicationInstance(), 90)).show();
	}

	public static void showToast(String text) {
		if (text != null) {
			CustomToast.makeText(MobileApplication.getApplicationInstance(), text, Toast.LENGTH_SHORT).setGravity(Gravity.BOTTOM, 0, ConvertUtils.dip2px(MobileApplication.getApplicationInstance(), 90)).show();
		}
	}

	public static void showToast(int resource) {
		CustomToast.makeText(MobileApplication.getApplicationInstance(), resource, Toast.LENGTH_SHORT).setGravity(Gravity.BOTTOM, 0, ConvertUtils.dip2px(MobileApplication.getApplicationInstance(), 90)).show();
	}
}
